package com.hq.ims.data.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.hq.ims.data.entity.BusInfoFeedback;
import com.hq.ims.data.entity.BusiIndustryCompany;
import com.hq.ims.data.entityenum.EnumNotificationWay;
import com.hq.ims.data.entityenum.EnumReceiveStatus;
import lombok.Data;
import lombok.Builder;
import com.hq.authority.utils.AppUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.time.LocalDateTime;
import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;
import javax.validation.constraints.NotBlank;

import com.hq.ims.data.vo.auth.BaseRowAuthVo;
import com.hq.ims.data.config.verification.VdEdit;
import com.hq.utils.util.ListUtils;
import java.util.stream.Collectors;


/**
 * @author 蒋柏平
 * @since 20241025
 */
@Mapper
public interface BusiIndustryCompanyMapstruct {

    BusiIndustryCompanyMapstruct INSTANCE = Mappers.getMapper(BusiIndustryCompanyMapstruct.class);

    //-------------------------------- 转换VO类 --------------------------------

    @Mappings({
    })
    BusiIndustryCompanyVo toBusiIndustryCompanyVo(BusiIndustryCompany source);

    default List<BusiIndustryCompanyVo> toBusiIndustryCompanyVoList(List<BusiIndustryCompany> source){
        if (source == null) {
            return ListUtils.newEmptyList();
        }
        return source.stream().map(this::toBusiIndustryCompanyVo).collect(Collectors.toList());
    }

    //-------------------------------- 以下为自定义类[输出对象] --------------------------------

    @ApiModel(value = "原始对象的扩展类")
    @Data
    class BusiIndustryCompanyVo extends BusiIndustryCompany {
        @ApiModelProperty(value = "接收状态")
        private EnumReceiveStatus receiveStatus;

        @ApiModelProperty(value = "拒收理由")
        private String reasonForRejection;

        @ApiModelProperty(value = "处理时间")
        @JSONField(format = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime handleDate;

        @ApiModelProperty(value = "推送时间")
        private LocalDateTime pushDate;
    }

    @ApiModel(value = "行级权限对象")
    @Data
    class BusiIndustryCompanyRowAuthVo extends BaseRowAuthVo {

        //自定义其它行级权限


        //构造函数
        public BusiIndustryCompanyRowAuthVo(BusiIndustryCompany entity){
            //当前操作用户ID
            String userId = AppUtils.getUserId();
        }
        
    }


    //-------------------------------- 以下为自定义类[输入对象] --------------------------------

    @ApiModel(value = "搜索VO")
    @Data
    class PageSearchVo {

    }

    @ApiModel(value = "添加和修改对象")
    @Data
    class SaveVo {

        @NotBlank(message = "数据ID不能为空", groups = {VdEdit.class})
        @ApiModelProperty(value = "数据ID")
        private String busiIndustryCompanyId;

        @ApiModelProperty(value = "产业标记ID")
        private String industryId;

        @ApiModelProperty(value = "产业标记名称")
        private String industryName;

        @ApiModelProperty(value = "公司ID")
        private String companyId;

        @ApiModelProperty(value = "公司名称")
        private String companyName;

        @ApiModelProperty(value = "经营信息管理ID")
        private String busiInfoId;

        @ApiModelProperty(value = "指定方式")
        private EnumNotificationWay notificationWay;



    }

    //-------------------------------- springboot验证标识 --------------------------------

}
